<template>
  <section>
    <el-input size="mini" style="width:80%" placeholder="请输入关键词" v-model="searchKey" @keydown.native.prevent.enter="searchBtn" clearable/>
    <i class="el-icon-search"  @click="searchBtn"/>
  </section>
</template>

<script>
  export default {
    name: "searchTool",
    data(){
      return{
        searchKey:null
      }
    },
    watch:{
      searchKey(nv,ov){
        console.log('变动了',nv)
        setTimeout(()=>{
          this.searchBtn()
        },1500)
      }
    },
    methods: {
      searchBtn(){
        this.$emit('search',this.searchKey)
      }
    }
  }
</script>

<style scoped>

</style>
